<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>只渲染一次</title>
</head>
<body>
<div id="app">
  <h1 abc="xyz">{{ message }}</h1>
  <h1 v-once>{{ message }}</h1>
</div>

<script type="module">

  import {createApp, ref} from "../../../../js/vue.esm-browser.js";

  const app = createApp({
    setup(){
      /*
      * 直接定义变量，无法在 Vue 开发者工具中修改变量的值
      * */
      /*return {
        message:"Hello, World!",
      }*/

      // let message = "Hello, World!"
      let message = ref("Hello, World!")
      return {
        message,
      }
    }
  })

  app.mount("#app")
</script>
</body>
</html>